<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <script src="./Promise.js"></script>
    </head>
    <body>
        <script>
            let p = new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve('ok');
                }, 2000)
            });

            // p 
            let result = p.then(
                (v) => {
                    
                },
                (r) => {
                    
                }
            );
            
            //状态显示 pending ,然后 2s 后变为 fulfilled
            console.log(result);

        </script>
    </body>
</html>
